Skip to content

AVRO-4258: [java] remove some allocations from decoder.getBytes() and Utf8 handling #3776

Open
mkeskells wants to merge 8 commits into
apache:mainfrom
mkeskells:AVRO-4258-getBytes
Open

AVRO-4258: [java] remove some allocations from decoder.getBytes() and Utf8 handling #3776
mkeskells wants to merge 8 commits into
apache:mainfrom
mkeskells:AVRO-4258-getBytes

Conversation

@mkeskells

Copy link
Copy Markdown
Contributor

Contribution Checklist

What is the purpose of the change

To reduce some allocations found during profiling for other changes (#3746)

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.
There is some trivial addition to the tests but only to ensure the methods are called

Note - I can't verify the change locally as Arvo doesn't build for me locally

Documentation

  • Does this pull request introduce a new feature? (no)

@github-actions github-actions Bot added the Java Pull Requests for Java binding label May 12, 2026
@mkeskells

Copy link
Copy Markdown
Contributor Author

Hi @opwvhk
I see spotless, and test errors on the run you started (thanks), but they seem to be on files I have not chnaged.
I am travelling today, so can only look on my phone so cant be sure

@opwvhk

opwvhk commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

I've taken the liberty to run spotless.

@mkeskells

Copy link
Copy Markdown
Contributor Author

Hi @opwvhk
feel free to make any chnages you feel appropriate, I am not precious on my PRs!
I cant run spotless before push, as it corrupts the code to a state where it doesnt compile
I am travelling and on hoiday, so I dont have a dev env with me, so happy to take any input on the 3 PRs I have open

@mkeskells

Copy link
Copy Markdown
Contributor Author

I have merged main

mkeskells and others added 6 commits June 1, 2026 12:00
Now colocated with `readBytes(ByteBuffer)` and `skipBytes()`
implementations.
move the implementation to child classes
reset utf8 string
…58-getBytes

# Conflicts:
#	lang/java/avro/src/main/java/org/apache/avro/io/BinaryDecoder.java
#	lang/java/avro/src/main/java/org/apache/avro/io/Decoder.java
#	lang/java/avro/src/main/java/org/apache/avro/io/ResolvingDecoder.java
#	lang/java/avro/src/main/java/org/apache/avro/util/Utf8.java
@mkeskells

Copy link
Copy Markdown
Contributor Author

Hi @opwvhk
I did some chnages while offline (much the same, push down and utf fixes), and merged with yours

@Fokko Fokko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@mkeskells

mkeskells commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Hi
I don't know the process here, is this able to be merged?
Also if someone can advise me on the best way to progress these issues, I can learn and use that knowledge on the other PRs that I have :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Java Pull Requests for Java binding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants